define(function (require, exports, module) {
    require('authorize');
    require('permission');
    require('global');

    var angular = require('angular');
    var util = require('util');

    require('service/app_store/appstoreService.js');


    angular.module('appStore.controllers', [])
        .controller('appStoreController', [
            '$scope', 'appStoreService',
            function ($scope, appstoreService) {
                $scope.apps = [
                    {
                        cls: 'apps-hot',
                        name: '热门应用',
                        list: [
                            {
                                name: '一元秒杀',
                                price: 0,
                                desc: '吸粉增到访神器',
                                logo: 'http://img-dev.myscrmimg.cn/projects/qmyx/public/images/pic/app_store/yyms.jpg',
                                url: '/api/index.php?r=site/redirect-to&page=wls&hash=act/msAct/list',
                                target: '_blank'
                            },
                            {
                                name: '刮一刮',
                                price: 0,
                                desc: '刮取奖品信息，快速增加粉丝',
                                logo: 'http://img-dev.myscrmimg.cn/projects/qmyx/public/images/pic/app_store/gyg.jpg',
                                url: '/api/index.php?r=site/redirect-to&page=wls&hash=games/guagua/list',
                                target: '_blank'
                            },
                            {
                                name: '中秋大作战',
                                price: 0,
                                desc: '玩游戏积累积分兑奖品，快速增加粉丝',
                                logo: 'http://img-dev.myscrmimg.cn/projects/qmyx/public/images/pic/app_store/zhongqiu.jpg',
                                url: '/api/index.php?r=site/redirect-to&page=wls&hash=act/dzzAct/list',
                                target: '_blank'
                            }
                        ]
                    },
                    {
                        cls: 'apps-o2o',
                        name: 'O2O游戏',
                        list: [
                            {
                                name: '大转盘游戏',
                                price: 0,
                                desc: '玩游戏中奖品，快速增加粉丝',
                                logo: 'http://img-dev.myscrmimg.cn/projects/qmyx/public/images/pic/app_store/dzp.jpg',
                                url: '/api/index.php?r=site/redirect-to&page=wls&hash=act/dzpAct/list',
                                target: '_blank'
                            },
                            {
                                name: '微信红包',
                                price: 0,
                                desc: '随机抽取红包游戏，快速增加粉丝',
                                logo: 'http://img-dev.myscrmimg.cn/projects/qmyx/public/images/pic/app_store/hongbao.jpg',
                                url: '/api/index.php?r=site/redirect-to&page=wls',
                                target: '_blank'
                            },
                            {
                                name: 'O2O游戏',
                                price: 0,
                                desc: '秒抢优惠商品，增加案场客户数',
                                logo: 'http://img-dev.myscrmimg.cn/projects/qmyx/public/images/pic/app_store/miaoqian.jpg',
                                url: '/api/index.php?r=site/redirect-to&page=wls&hash=partys/game520/list',
                                target: '_blank'
                            }
                        ]
                    },
                    {
                        cls: 'apps-other',
                        name: '其他游戏',
                        list: [
                            {
                                name: '新微楼书',
                                price: 0,
                                desc: '丰富的模板，全新的体验',
                                logo: 'http://img-dev.myscrmimg.cn/projects/qmyx/public/images/pic/app_store/wls.jpg',
                                url: '/api/index.php?r=site/redirect-to&page=wls&hash=loushu/list',
                                target: '_blank'
                            }
                        ]
                    }
                ];

                $scope.appsRank = [
                    {name: '一元秒杀', hot: 5},
                    {name: '中秋大作战', hot: 5},
                    {name: '微信红包', hot: 45},
                    {name: '刮一刮活动', hot: 45},
                    {name: '大转盘游戏', hot: 45},
                    {name: '微场景', hot: 4},
                    {name: '新版微楼书', hot: 4},
                    {name: '认筹理财', hot: 4},
                    {name: '一键拨号', hot: 35},
                    {name: '普通相册', hot: 35},
                    {name: '360全景相册', hot: 3},
                    {name: '税费计算器', hot: 3},
                    {name: '老版微楼书', hot: 3}
                ];
            }
        ]);

    angular.module('appStore', ['appStore.services', 'appStore.controllers']);

    angular.bootstrap(document, ['appStore']);
});